<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>03-鼠标单击和双击事件</title>
    <script>
        window.onload=function () {
            // 双击事件 onclick
            document.getElementById("box").onclick=function () {
                alert("盒子1被单击");
            }
            // 双击事件 ondblclick
            document.getElementById("box1").ondblclick=function (){
                alert("盒子2被双击")
            }
        }
    </script>
</head>
<body>
<div id="box">我是盒子1</div>
<div id="box1">我是盒子2</div>
</body>
</html>